package cn.edu.xmu.restfuldemo.model.BO;

import cn.edu.xmu.restfuldemo.model.PO.GoodsPo;
import lombok.*;

import java.time.LocalDateTime;

/**
 * @author Team3-5
 */
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
@ToString
public class Goods {
    private Long id;
    private String name;
    private Long brandId;
    private Long freightId;
    private Long shopId;
    private String goodsSn;
    private String detail;
    private String imageUrl;
    private Byte disabled;
    private LocalDateTime gmtCreate;
    private LocalDateTime gmtModified;

    /**
     * Goods->GoodsPo
     * @return
     */
    public GoodsPo newGoodsPo(){
        GoodsPo goodsPo = new GoodsPo();
        goodsPo.setId(this.id);
        goodsPo.setName(this.name);
        goodsPo.setBrandId(this.brandId);
        goodsPo.setFreightId(this.freightId);
        goodsPo.setShopId(this.shopId);
        goodsPo.setGoodsSn(this.goodsSn);
        goodsPo.setDetail(this.detail);
        goodsPo.setImageUrl(this.imageUrl);
        goodsPo.setDisabled(this.disabled);
        goodsPo.setGmtCreate(this.gmtCreate);
        goodsPo.setGmtModified(this.gmtModified);
        return goodsPo;
    }

}
